<?php

/**
 * TemperatureType form base class.
 *
 * @method TemperatureType getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseTemperatureTypeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ITEMPERATURE_TYPE' => new sfWidgetFormInputHidden(),
      'SDESC_TH'          => new sfWidgetFormInputText(),
      'SDESC_ENG'         => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ITEMPERATURE_TYPE' => new sfValidatorChoice(array('choices' => array($this->getObject()->getItemperatureType()), 'empty_value' => $this->getObject()->getItemperatureType(), 'required' => false)),
      'SDESC_TH'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'SDESC_ENG'         => new sfValidatorString(array('max_length' => 100, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('temperature_type[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TemperatureType';
  }


}
